import { get } from "@/api/axios"
import type { BiuJsonResult } from "@/api/biu-json-result"

export interface ConnectionStateRow {
  hostPort: {
    protocol: string
    host: string
    port: number
  }
  connectionType: string
  connectionNum: number
  createTime: number
}

export type ConnectionState = Array<ConnectionStateRow>

export interface HttpHttpsProxyServiceOverview {
  directConnectionNumber: number
  proxyConnectionNumber: number
  directTrafficIn: number
  directTrafficOut: number
  proxyTrafficIn: number
  proxyTrafficOut: number
  connectionState: ConnectionState
}

export function doHttpHttpsProxyServiceOverview() {
  return get<BiuJsonResult<HttpHttpsProxyServiceOverview>>("/api/overview/http-https-proxy-service")
}
